package com.oa.srms.apps.dao.student.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.oa.srms.apps.dao.student.IStudentDetailDao;
import com.oa.srms.apps.entity.student.StudentDetailValue;

public class StudentDetailDaoImpl extends HibernateDaoSupport implements
		IStudentDetailDao {

	@Override
	public Integer addStudentDetail(StudentDetailValue studentDetailValue)
			throws Exception {
		if (studentDetailValue != null) {
			this.getHibernateTemplate().save(studentDetailValue);
		}
		return studentDetailValue.getId();
	}

	@Override
	public void editStudentDetail(StudentDetailValue studentDetailValue)
			throws Exception {
		if (studentDetailValue != null) {
			this.getHibernateTemplate().update(studentDetailValue);
		}

	}

	@Override
	public StudentDetailValue queryById(Integer id) throws Exception {
		return (StudentDetailValue) this.getHibernateTemplate().get(StudentDetailValue.class, id);
	}

}
